<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let i = +prompt("请输入一个数")
        if (i > 5000 || i < 500) {
            alert("请重新输入")
        }
    </script>
</body>

</html>